package com.sk.cardeal.act.home.activity;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.dyhdyh.widget.loading.dialog.LoadingDialog;
import com.sk.cardeal.R;
import com.sk.cardeal.base.BaseActivity;
import com.sk.cardeal.entity.Model;
import com.sk.cardeal.utils.HttpAddress;
import com.sk.cardeal.utils.MyUtils;
import com.sk.cardeal.view.TitleView;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by sk on 2018/3/8.
 */

public class FixInfoActivity extends BaseActivity {
    @BindView(R.id.title_view)
    TitleView titleView;
    @BindView(R.id.icon)
    ImageView icon;
    @BindView(R.id.tv_brand)
    TextView tvBrand;
    @BindView(R.id.tv_model)
    TextView tvModel;
    @BindView(R.id.data_ryc)
    RecyclerView dataRyc;

    private String carId = "";
    private LoadingDialog loadingDialog;
    private Model model;
    private String url = "";

    @Override
    protected int getContentView() {
        return R.layout.activity_fix_info;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        titleView.setMyCallBack(this);
        loadingDialog = MyUtils.getLoadingDialog(mContext, false);
        model = getIntent().getParcelableExtra("model");
        url = getIntent().getStringExtra("url");

        tvBrand.setText(model.getBrandName());
        tvModel.setText(model.getText());

        Glide.with(mContext).load(HttpAddress.ossPath+url).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(icon);

    }

    @Override
    public void clickTitle(int i) {
        super.clickTitle(i);
        switch (i){
            case 1:
                finish();
                break;
        }
    }
}
